package com.bsj.power.common.def.entity.syncLog;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bsj.power.common.constant.NumericalConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description SyncLog
 * @time 2024/8/27 9:29
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tab_sync_log")
public class SyncLog {

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 总数
     */
    @TableField(value = "total")
    private Integer total;

    /**
     * 同步类型 1工单
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public SyncLog(Integer total) {
        this.total = total;
        this.type = NumericalConstants.ONE;
    }
}
